#!/bin/tcsh
set com = /usr/local/pem/bin/plotana
set tmpdir = /home/pem/tmp
set plotter = /usr/local/bin/plotmtv
set fin = $1
set foutb = $fin:t:r
set fout = ${foutb}.mtv

if( -e $com ) then
echo  $com "$fin" $tmpdir/$fout "Sensitivity $1"
  $com "$fin" $tmpdir/$fout "Sensitivity $1"
  set rc = $?
  if( $rc == 0 ) then
    if( -e $plotter ) then
	$plotter -pscolor $tmpdir/${foutb}*.mtv
	rm -f $tmpdir/${foutb}*.mtv
    else
	echo "No such file: $plotter"
	exit 127
    endif
  else
    exit $rc
  endif
else
  exit 128
endif
